package com.congee02.bt.dfs.top2bottom;

import com.congee02.bt.TreeNode;

public class MaxDepth {

    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        return 1 + Math.max(
                maxDepth(root.left),
                maxDepth(root.right)
        );
    }

}
